-
Notifications
You must be signed in to change notification settings - Fork 0
feat: add social OAuth (GitHub and Discord) #49
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a really cool feature!
It would be nice to have a short guide in the README explaining what needs to be set up to get this working. I couldn't get Discord login to work when giving it a quick test
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing VITE_APP_URL fails silently with “Invalid callbackURL”. callbackURL is built as ${import.meta.env.VITE_APP_URL}/project2/. Without frontend/.env, it becomes undefined/project2/, and better-auth rejects it with a 403. Nothing in the UI says why. Suggest either import.meta.env.VITE_APP_URL ?? window.location.origin, or better, a relative callbackURL: import.meta.env.BASE_URL so no extra env variable is needed. Also show a toast when signIn.social returns an error, and document VITE_APP_URL in deployment.md.
AI generated comment ^
|
It's a nice feature, I agree with @hestro on that. However, if this is too much trouble to integrate into the website it might be worth atleast pausing until the criteria of milestone 3 is met. That being said, if this is something you like to work on, I'm not going to stop you from it. |
We cannot have a relative link like that, since that would send us to the backend at port However, thanks for mentioning the issue that comes up if the environment variable is not defined. I have now explicitly documented this, and the fallback you mention with using |
|
The issues mentioned should be fine, and I also provided some documentation in aa0a6a6 so it should be easier to test. Let me know if you guys encounter any difficulties |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! Tested both GitHub and Discord login and they work as expected
|
@hestro Could you approve this again? Needed to resolve a merge conflict before merging. |
This PR adds OAuth from other services (GitHub and Discord) to make it even easier to log in or sign up to our app.
better-authtakes care of connecting email and password accounts with OAuth accounts, so that the same user doesn't have two different accounts depending on the way they log in.To be merged after #45 since this PR builds upon that